import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Search from '../views/Search.vue'
import Detail from '../views/Detail.vue'

const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/detail/:id',
    component: Detail
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
